﻿using System;
using System.Collections.Generic;
using System.Text;
using Lswweb.Model;
using System.Web.UI.WebControls;
using Lswweb.Domain;

namespace Lswweb.Controls
{                
    public class NewSearchType:DropDownList
    {
        public NewSearchType() 
        {
            Enum<SearchKeyType>.BinderToListControl(this);
        }
        public new SearchKeyType SelectedValue 
        {
            get
            {
                EnsureChildControls();
                return (SearchKeyType)Convert.ToInt32(base.SelectedValue);
            }
            set
            {
                EnsureChildControls();
                ListItem item = base.Items.FindByValue(((int)value).ToString());
                if (item != null)
                {
                    this.SelectedIndex = -1;
                    item.Selected = true;
                }
            }
        
        }
    }
}
